﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Pot4a01
    {
		private string _listid;
		private string _plistid;
		private string _splistid;
		private string _slistid;
		
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 促销单号
        /// </summary>
		public string Plistid
		{
			get { return _plistid;	 }
			set { _plistid=value;	}
		}
        /// <summary>
        /// 门店标识
        /// </summary>
		public string Splistid
		{
			get { return _splistid;	 }
			set { _splistid=value;	}
		}
        /// <summary>
        /// 销售商标识
        /// </summary>
		public string Slistid
		{
			get { return _slistid;	 }
			set { _slistid=value;	}
		}
		
		public static List<Pot4a01> GetPot4a01ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Pot4a01> list = new List<Pot4a01>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Pot4a01 model = GetPot4a01ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Pot4a01 GetPot4a01ByDataRow(DataRow dr)
		{
			Pot4a01 model = new Pot4a01(); //实例化Pot4a01
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			if (dcc.Contains("plistid")&&!(dr["plistid"] is System.DBNull))  
				model.Plistid = ( string)dr["plistid"];
			if (dcc.Contains("splistid")&&!(dr["splistid"] is System.DBNull))  
				model.Splistid = ( string)dr["splistid"];
			if (dcc.Contains("slistid")&&!(dr["slistid"] is System.DBNull))  
				model.Slistid = ( string)dr["slistid"];
			
			return model;
		}
    }
}
